<?php

namespace falcon5\inc\Helpers;

use falcon5\inc\Base\Common;
use lucatume\DI52\ContainerException;

/**
 * Class AssetsHelper
 * @package falcon5\inc\Helpers
 * @desc
 */
class AssetsHelper
{

    /**
     * @return string
     * @throws ContainerException
     * @desc 获取网址静态资源目录uri
     */
    public static function getAssetUri(): string
    {
        return self::getResourceUri() . '/assets';
    }

    /**
     * @return string
     * @throws ContainerException
     * @desc 获取多语言文件夹路径
     */
    public static function getLanguagePath(): string
    {
        $common = falcon5_app(Common::class);
        return $common->plugin_path . 'languages';
    }

    /**
     * @return string
     * @throws ContainerException
     * @desc 获取模板文件目录
     */
    public static function getTemplatePath(): string
    {
        $common = falcon5_app(Common::class);
        return $common->plugin_path . 'templates';
    }

    /**
     * @return string
     * @throws ContainerException
     * @desc 获取 Resource 文件夹路径
     */
    public static function getResourcePath(): string
    {
        $common = falcon5_app(Common::class);
        return $common->plugin_path . 'resources';
    }

    /**
     * @return string
     * @throws ContainerException
     * @desc 获取 Resource 文件夹uri
     */
    public static function getResourceUri(): string
    {
        $common = falcon5_app(Common::class);
        return $common->plugin_url . 'resources';
    }

    public static function getRootPath(): string
    {
        $common = falcon5_app(Common::class);
        return $common->plugin_path;
    }

}